//SKU模块接口问题
import { request } from "@/utils/request";
import { SkuInfoData, SkuResponseDate } from "./type";

//枚举地址
enum API{
    SKU_URL = '/admin/product/list/',
    //admin/product/cancelSale/{skuId}上架
    //admin/product/onSale/{skuId}下架
    //上架
    SALE_URL = 'admin/product/onSale/',
    //下架
    CANCELSALE_URL = 'admin/product/cancelSale/',
    //获取商品详情
    SKUINFO_URL = '/admin/product/getSkuInfo/',
    //删除已有商品
    DELECTSKU_URL = '/admin/product/deleteSku/'
}
//获取sku接口
export const reqSkuList = (page:number,limit:number)=>request.get<any,SkuResponseDate>(API.SKU_URL+`${page}/${limit}`)
//商品上架接口
export const reqOnSale = (skuId:number)=>request.get<any,any>(API.SALE_URL+skuId)
//商品下架接口
export const reqCancelSale = (skuId:number)=>request.get<any,any>(API.CANCELSALE_URL+skuId)
//获取商品详情方法
export const reqSkuInfo = (skuId:number)=>request.get<any,SkuInfoData>(API.SKUINFO_URL+skuId)
//删除商品方法
export const reqRemoveSku = (skuId:number)=>request.get<any,any>(API.DELECTSKU_URL+skuId)